public abstract class ArrayQueue<E> implements Queue<E> {

    private Array<E> array;

    public ArrayQueue(int capacity) {
        array = new Array<E>(capacity);
    }

    public ArrayQueue() {
        array = new Array<E>();
    }

    public int getSize() {
        return array.getSize();
    }

    public boolean isEmpty() {
        return array.isEmpty();
    }

    public void enqueue(E e) {
        array.addLast(e);
    }

    public E dequeue() {
        return array.removeFirst();
    }

    public E getFront() {
        return array.getFirst();
    }

    public E contains(E e) {
        return null;
    }

    public E getData(int e){
        return array.get(e);
    }

    @Override
    public String toString(){
        StringBuilder res = new StringBuilder();
        res.append("Queue: ");
        res.append("front [");
        for(int i =0 ; i < array.getSize() ; i++){
            res.append(array.get(i));
            //如果当前size不是最后一个，则添加一个,
            if(i != array.getSize() -1){
                res.append(", ");
            }
        }
        res.append("] tail");
        return res.toString();

    }
}
